#!/usr/bin/python
# -*- coding: UTF-8 -*-

"""
Description: TestCli命令

Copyright © Huawei Technologies Co., Ltd. 2020-2025. All rights reserved.

Changelog: 2024/10/9 11:11 created

"""
from kptest.api.apibase import ApiBase
from kptest.config.enum import HostType
from extension.api.huakunipmi import ipmi_ns


@ipmi_ns.dispatchertype(HostType.Local, HostType.HostOS)
class HkIpmi(ApiBase):

    def __init__(self):
        super(HkIpmi, self).__init__()

    def get_mc_info(self, params=None):
        result = self.dispatch("ipmi_get_mc_info", params=params)[0]["parser"]
        return result

    def get_fru_info(self, params=None):
        result = self.dispatch("ipmi_get_fru_info", params=params)[0]["parser"]
        return result

    def get_sdr_info(self, params=None):
        return self.dispatch("ipmi_get_sdr_info", params=params)[0]["parser"]

    def set_dpu_power_status(self, params=None):
        return self.dispatch("ipmi_set_dpu_power_status", params=params)[0]["parser"]

    def set_dpu_boot_dev(self, params=None):
        return self.dispatch("ipmi_set_dpu_boot_dev", params=params)[0]["parser"]

    def get_dpu_boot_dev(self, params=None):
        return self.dispatch("ipmi_get_dpu_boot_dev", params=params)[0]["parser"]

    def set_chassis_power_status(self, params=None):
        return self.dispatch("ipmi_set_chassis_power_status", params=params)[0]["parser"]
